package com.game.screen;

import com.game.util.Color;
import com.game.util.Coord;
import com.game.util.ProcessingObject;

public class Collision extends ProcessingObject {

	public Collision() {
		super();
	}

	public static boolean isCollision(Sprite s1, Sprite s2) {
		
	
		
		// get the pixel location of the Sprites
		float s1x = s1.getX() + s1.width/2;
		float s1y = s1.getY() + s1.height/2;
		float s2x = s2.getX() + s2.width/2 + 10;
		float s2y = s2.getY() + s2.height/2;

		return pApplet.dist(s1x, s1y, s2x, s2y) < 35;
		
		// check if the two sprites' boundaries intersect
//		return (
//				s1x < s2x + s2.getWidth() && s2x < s1x + s1.getWidth() && 
//				s1y < s2y + s2.getHeight() && s2y < s1y + s1.getHeight());
	}

}
